<?php

namespace app\admin\validate\user;

use think\Validate;

class EditPassword extends Validate
{
    protected $rule = [
        'old_password' => 'require|token',
        'new_password' => 'require|alphaNum|max:16|min:6',
        'check_password' => 'require|confirm:newPassword'
    ];

    protected $message = [
        'old_password.require' => '请输入旧密码',
        'new_password.require' => '新密码不能为空',
        'new_password.max' => '新密码不能超过16个字符',
        'new_password.min' => '新密码不能少于6个字符',
        'new_password.alphaNum' => '新密码由字母或数字组成',
        'check_password.require' => '请输入确认密码',
        'check_password.confirm' => '两次输入的密码不一致',
    ];
}